from flask_wtf import Form
from wtforms import StringField, PasswordField, SubmitField
from wtforms.validators import DataRequired, Length


class LoginForm(Form):
    username = StringField('用户名', validators=[DataRequired(message='用户名不能为空'), Length(min=1, max=10)])
    password = PasswordField('密码', validators=[DataRequired(), Length(min=6, max=20)])
    submit = SubmitField('登录')